<script setup>
defineProps({
  progress: {
    type: Array,
    required: true
  }
});

const statusMap = {
  booked: { type: 'success', icon: 'Check' },
  pending: { type: 'warning', icon: 'Clock' },
  inProgress: { type: 'primary', icon: 'Loading' },
  completed: { type: 'success', icon: 'CircleCheck' },
  cancelled: { type: 'danger', icon: 'Close' }
};

const getStatusInfo = (status) => statusMap[status] || { type: 'info', icon: 'More' };
</script>

<template>
  <el-timeline>
    <el-timeline-item
      v-for="(item, index) in progress"
      :key="index"
      :type="getStatusInfo(item.status).type"
      :icon="getStatusInfo(item.status).icon"
      :timestamp="item.time"
    >
      {{ item.title }}
    </el-timeline-item>
  </el-timeline>
</template>

<style scoped>
:deep(.el-timeline-item__node) {
  background-color: var(--el-color-primary);
}

:deep(.el-timeline-item__content) {
  font-size: 14px;
  color: var(--el-text-color-primary);
}

:deep(.el-timeline-item__timestamp) {
  font-size: 13px;
  color: var(--el-text-color-secondary);
}
</style> 